<?php

/**
 * Created by PhpStorm.
 * User: beizhihai
 * Date: 2019/4/29
 * Time: 6:50 PM
 */

namespace App\Service;


use Overtrue\Socialite\Providers\WeChatProvider;

class WechatOauthShareService extends WeChatProvider
{
    private $myScope;
    public function __construct($config)
    {
        parent::__construct(request(), $config['app_id'], $config['secret'], $config['redirect'] ?? request()->fullUrl());
        $this->myScope = $config['scope'] ?? 'snsapi_base';
    }

    /**
     * {@inheritdoc}.
     */
    protected function getAuthUrl($state)
    {
        return 'http://ee.bzh001.com/wechat-oauth?callback=' . $this->redirectUrl . '&scope=' . $this->myScope;
    }
}
